package com.wen.common.constant;

import java.util.Random;

/**
 * 错误码消息枚举
 */
public enum MsgCodeEnum implements MsgCode {
    SUCCESS(0, "操作成功"),
    ERROR(1, "操作失败"),
    SERVICE_ERROR(5, "服务器错误");

    private int code;
    private String message;

    MsgCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String toString() {
        return this.code + "_" + this.message + Math.random();
    }
}
